package registry

import (
	"time"
)

type Options struct {
	Addrs []string
	//超时
	Timeout time.Duration
	//心跳时间
	HeartBeat int64
	// 注册地址
	RegistryPath string
}

//定义一个函数类型的变量
type Option func(opts *Option)

func WithAddrs(addrs []string) Option {
	return func(opts *Options) {
		opts.Addrs = addrs
	}
}
func WithTimeout(timeout time.Duration) Option {
	return func(opts *Options) {
		opts.Timeout = timeout
	}
}
func WithHeartBeat(heartBeat int64) Option {
	return func(opts *Options) {
		opts.HeartBeat = heartBeat
	}
}
func WithRegistryPath(path string) Option {
	return func(opts *Options) {
		opts.RegistryPath = path
	}
}
